Skip to content

feat: add --auto flag to use the available model of "Auto"#4

Open
lanternian wants to merge 2 commits into
betaHi:mainfrom
lanternian:feat/auto
Open

feat: add --auto flag to use the available model of "Auto"#4
lanternian wants to merge 2 commits into
betaHi:mainfrom
lanternian:feat/auto

Conversation

@lanternian
Copy link
Copy Markdown

GitHub introduced a weekly quota. When a model’s quota is exhausted you can’t select models manually — selection must be done via Auto (automatic routing). By providing a special auto credential (the Copilot-Session-Token), we can freely request models that are available to Auto.

add --auto flag tobypass the auto-selection routing and provide an auto-available model when the planned models' quota is exhausted.

available models includes: gpt-5-mini, claude-haiku-4.5, gpt-5.4-mini, gpt-5.3-codex, gpt-4.1, gpt-4o

@lanternian lanternian changed the title feat: add --auto flag to use the available of "auto mode" feat: add --auto flag to use the available model of "Auto" May 16, 2026
@betaHi
Copy link
Copy Markdown
Owner

betaHi commented May 17, 2026

Thanks @lanternian for the PR, this looks promising.

Could you help add some tests before we merge? I’d like to cover the auto headers, and also the model-selection behavior when the existing Codex model is not in available_models.

We should make sure --auto actually uses an auto-available model instead of silently keeping or falling back to a non-auto model.

@lanternian
Copy link
Copy Markdown
Author

lanternian commented May 27, 2026

Thanks for your reply. Based on your advise I make some work:

I added a test auto-mode.test.ts to verify that when selecting a non-auto model under auto mode, it returns a 400 error instead of silently falling back to other models.

In additon, auto-mode.test.ts also verify these following feature:

When selecting Auto mode, the prompt's selectable models should only include auto-available models, preventing users from selecting non-auto-available models.

In Auto mode, the copilot-session-token is only carried when sending chat/response requests; in all other routers, it stays as the original default.

When a user uses --model to override the model, if the specified model is not in the auto-available list, a API Error: 400 Requested model not available for session error is returned, keeping the same behavior as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants